| 1 | --- |
| 2 | import Layout from "../../components/Layout.astro"; |
| 3 | |
| 4 | // Under `output: "static"` every dynamic route MUST enumerate its paths at |
| 5 | // build time — this is the defining static behavior (contrast with |
| 6 | // packages/frontend-frameworks/fixtures/astro-ssr, where any param resolves at request time). |
| 7 | export function getStaticPaths() { |
| 8 | return [ |
| 9 | { params: { slug: "first-post" }, props: { title: "First post" } }, |
| 10 | { params: { slug: "second-post" }, props: { title: "Second post" } }, |
| 11 | ]; |
| 12 | } |
| 13 | |
| 14 | const { slug } = Astro.params; |
| 15 | const { title } = Astro.props; |
| 16 | --- |
| 17 | |
| 18 | <Layout title={title}> |
| 19 | <h1 id="title">{title}</h1> |
| 20 | <p id="slug">{slug}</p> |
| 21 | <p id="mode">static</p> |
| 22 | </Layout> |